
const apiStatus = require('../../apiStatus');
const toolsService = require('./toolsService');

function setup(app, appRouter){
    appRouter.get('/tools/app/getConfig', async(ctx,next) => {
        var appName = ctx.request.query.appName;
        var appInfo = await toolsService.getConfig(appName);
        ctx.apiBody = appInfo;

        next();
    });

    appRouter.get('/tools/app/getPages', async(ctx,next) => {
        var appId = ctx.request.query.appId;
        var pages = await toolsService.getPages(appId);
        ctx.apiBody = pages;

        next();
    });
}

module.exports = setup;
